package com.codefish.framework.spring.beans.factory.config;

import com.codefish.framework.spring.beans.annotation.DependencyDescriptor;
import com.codefish.framework.spring.beans.factory.IBeanFactory;
import com.codefish.framework.spring.beans.factory.support.PropertyValue;

import java.lang.reflect.Member;
import java.util.Collection;
import java.util.List;
import java.util.Set;

/**
 * ‘AutowireCapableBeanFactory接口
 *
 * @author <a href='https://gitee.com/hzf2281'>codefish</a>
 * @version 1.0.0
 * @since 2022/10/03 下午 04:15
 */
public interface IAutowireCapableBeanFactory extends IBeanFactory {
    /**
     * 应用BeanPostProcessor链中的所有beforeXX方法，如果某次调用后返回null，则返回本次调用前的对象
     * @param existingBean 目标bean实例
     * @param beanName beanName
     * @return 处理后的bean对象
     */
    Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName);
    /**
     * 应用BeanPostProcessor链中的所有afterXX方法，如果某次调用后返回null，则返回本次调用前的对象
     * @param existingBean 目标bean实例
     * @param beanName beanName
     * @return 处理后的bean对象
     */
    Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName);


    /**
     * 返回符合依赖条件的bean实例对象
     * @param dependencyDescriptor 需要注入的域，可能为Field/Method/Constructor
     * @param requestingBeanName 请求注入依赖ben的beanName
     * @param requiredBeanNames 所有希望依赖的beanName
     * @return 符合依赖条件的bean实例对象
     */
    Object resolveDependency(DependencyDescriptor dependencyDescriptor, String requestingBeanName, Set<String> requiredBeanNames);

}
